//创建Vuex的核心store
import Vue from "vue";
import Vuex from 'vuex'

Vue.use(Vuex)

const actions = {
  changeActivePath(context,value){
    //提交给mutations更新state的数据
    context.commit("doChangeActivePath",value)
  }
}

const mutations ={
  //实际更新state中的数据
  doChangeActivePath(state,value){
    state.activePath = value
  }
}

const state ={
  activePath : '/index'
}


export default new Vuex.Store({
  actions,
  mutations,
  state
})